package ee.ut.aa.neuraltic.neural;

import java.util.Arrays;

import org.apache.log4j.Logger;

public class OutputLayer extends Layer {

	private static Logger log = Logger.getLogger( OutputLayer.class );

	public OutputLayer( Layer nextLayer ) {

		super( nextLayer );
		initNeurons( 1 );
	}

	public double[] retreiveOutput() {

		double[] result = new double[getNeurons().size()];

		int i = 0;
		for( Neuron neuron : getNeurons() ) {
			result[i++] = neuron.getValue();
		}

		log.debug( "Returning output layer result=" + Arrays.toString( result ) );

		return result;
	}
}
